package com.bbzn.device.client.dao.video;

import com.bbzn.device.client.dataobject.Video;
import com.bbzn.device.client.dto.video.VideoDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface VideoMapper {
    int deleteByPrimaryKey(Long videoId);

    int insert(Video record);

    int insertOrUpdate(Video record);

    int insertOrUpdateSelective(Video record);

    int insertSelective(Video record);

    Video selectByPrimaryKey(Long videoId);

    int updateByPrimaryKeySelective(Video record);

    int updateByPrimaryKey(Video record);

    int updateBatch(List<Video> list);

    int updateBatchSelective(List<Video> list);

    int batchInsert(@Param("list") List<Video> list);

    /**
     * 用户获赞总数
     * @param userPhone
     * @return
     */
    Integer selectSumAgreeSelective(@Param("userPhone") String userPhone);

    /**
     * 查询视频列表
     *
     * @return
     * @throws Exception
     */
    List<VideoDTO> selectPageSelective(VideoDTO record);

    int selectCountPageSelective(VideoDTO record);

    List<VideoDTO> selectBySelective(Video record);

    List<VideoDTO> selectIsLikedVideo(@Param("userPhone") String userPhone);
    /**
     * 查询当前登录的用户点赞和关注过的视频和博主
     * @param record
     * @return
     */
    List<VideoDTO> selectPageLonginUPhoneSelective(VideoDTO record);

    int selectCountPageLonginUPhoneSelective(VideoDTO record);

    String selectByAuthorPictureUrl(@Param("userPhone") String userPhone);

    /**
     * 查询自己的发布的所有视频列表
     * @param record
     * @return
     */
    List<VideoDTO> getUserVideoInfo(VideoDTO record);

    /**
     * 返回所有关注人视频列表数据
     * @param record
     * @return
     */
    List<VideoDTO> getFollowUserVideoList(VideoDTO record);

    int getCountFollowUserVideoList(VideoDTO record);

    List<VideoDTO> findFollowUserVideoList(VideoDTO record);

}